Machine Learning Lab

Lab 9 - Implement Single Layer Perceptron from scratch


S Shyam Sundaram
19BCE1560
October 4, 2021

Dr Abdul Quadir MD
L31+L32

Note:

The plots below are interactive. Feel free to zoom and rotate them.

Prediction function

So it reached accuracy of 100% in the 3rd iteration itself.
The weights are:

Iris dataset with SciKit learn's perceptron


Iris with code from scratch


The model made from scratch performs just as well as the built-in perceptron model in SciKit-learn. It reached an accuracy of 100% in just 9 iterations.